﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Jim.Core;


[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public class SdkAttribute : Attribute
{
    public SdkAttribute(string url, string description = "", string method = "post")
    {
        Url = url;
        Method = method.Equals("post", StringComparison.OrdinalIgnoreCase) ? HttpMethod.Post : HttpMethod.Get;
        Description = description;
    }

    /// <summary>
    /// 请求路径，不能为空
    /// </summary>
    [Description("请求路径，不能为空")]
    public string Url { get; set; }
    /// <summary>
    /// 请求方式,默认Post
    /// </summary>
    [Description("请求方式,默认Post")]
    public HttpMethod Method { get; set; } 

    /// <summary>
    /// 接口描述
    /// </summary>
    public string Description { get; set; }

}
